package com.test.gwt.mvp.shared;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Utils {

	private final Map<Integer, Mail> map;
	
	public static final Utils INSTANCE = new Utils();
	
	private Utils(){
		map = new HashMap<Integer, Mail>();
		map.put(1, new Mail(1, "Amin. Rol", "A propos du ...", "ikqsdk liuqsjhk n usnld, qsd,klqsknd mqlsd,"));
		map.put(2, new Mail(2, "Damien. Alix", "A propos du ...", "IKQSDK LIUQSJHK N USNLD, QSD,KLQSKND MQLSD,"));
		map.put(3, new Mail(3, "André. Tan", "A propos du ...", "ikqsdk liuqsjhk n usnld, qsd,klqsknd mqlsd,"));
		map.put(4, new Mail(4, "Arielle. Roux", "A propos du ...", "IKQSDK LIUQSJHK N USNLD, QSD,KLQSKND MQLSD,"));
		map.put(5, new Mail(5, "Jean. Habib", "A propos du ...", "ikqsdk liuqsjhk n usnld, qsd,klqsknd mqlsd,"));
	};
	
	public Mail getById(Integer id){
		return map.get(id);
	}
	
	public List<Mail> getList(){
		return new ArrayList<Mail>(map.values());
	}
}
